package com.weiyuwqj.server.service.contracts.impl;

import com.github.pagehelper.PageHelper;
import com.timevale.esign.sdk.tech.service.AccountService;
import com.timevale.esign.sdk.tech.service.EsignsdkService;
import com.timevale.esign.sdk.tech.service.SealService;
import com.timevale.esign.sdk.tech.service.factory.AccountServiceFactory;
import com.timevale.esign.sdk.tech.service.factory.EsignsdkServiceFactory;
import com.timevale.esign.sdk.tech.service.factory.SealServiceFactory;
import com.timevale.esign.sdk.tech.service.factory.SignServiceFactory;
import com.weiyuwqj.api.common.PageList;
import com.weiyuwqj.api.common.Paginator;
import com.weiyuwqj.api.model.SysContracts;
import com.weiyuwqj.api.model.vo.ContractsVo;
import com.weiyuwqj.api.service.SysContractsService;
import com.weiyuwqj.server.mapper.SysContractsMapper;
import com.weiyuwqj.server.service.base.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * Created by huzj on 2016/8/15.
 */
@Service("contractsService")
public class SysContractsServiceImp extends BaseServiceImpl<SysContracts> implements SysContractsService {
    @Autowired
    SysContractsMapper contractsMapper;

    @Override
    public PageList getList(Paginator p, Map<String, Object> map) {
        PageHelper.startPage(p.getPageNum(), p.getPageSize());
        List<ContractsVo> list = contractsMapper.getList(map);
        return new PageList(list);
    }

    @Override
    public SysContracts getContractsByInvestId(Integer investId) {
        return contractsMapper.getContractsByInvestId(investId);
    }

    @Override
    public PageList listByItemId(Paginator paginator, Map map) {
        PageHelper.startPage(paginator.getPageNum(), paginator.getPageSize());
        List<ContractsVo> list = contractsMapper.listByItemId(map);
        return new PageList(list);
    }



}
